let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start");
                var _n85,
                    i =
                    (this && this.__extends) ||
                    ((_n85 = function n(t, e) {
                            return (_n85 =
                                Object.setPrototypeOf ||
                                ({
                                        __proto__: []
                                    }
                                    instanceof Array &&
                                    function(t, e) {
                                        t.__proto__ = e;
                                    }) ||
                                function(t, e) {
                                    for (var o in e) {
                                        Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                                    }
                                })(t, e);
                        }),
                        function(t, e) {
                            function o() {
                                this.constructor = t;
                            }
                            _n85(t, e),
                                (t.prototype =
                                    null === e ?
                                    Object.create(e) :
                                    ((o.prototype = e.prototype), new o()));
                        });
                Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.EnemyCtrl = void 0);
                var r = t('MonsterActor'),
                    a = t('BattleUtils'),
                    s = t('MonsterInfo'),
                    c = t('AbsInfo'),
                    l = t('MathUtils'),
                    u = t('AbsCtrl'),
                    h = t('ItemActor'),
                    p = t('ChapterRoundCfg'),
                    f = t('ArrayUtils'),
                    d = (function(t) {
                        function e(e, o) {
                            var n = t.call(this, e) || this;
                            return (n._chapter = o), (n._camp = 2), n;
                        }
                        return (
                            i(e, t),
                            (e.prototype.onRoundChanged = function(t) {
                                var e = a.default.buildMonsterList(t),
                                    o = [],
                                    n = p.ChapterRoundCfg.ins.getDataByRound(
                                        t.chapterId,
                                        t.round + 1
                                    );
                                if (n) {
                                    var i = Math.floor(e.length / 3),
                                        r = l.default.splitInt(n.step, i);
                                    o = o.concat(r);
                                }
                                f.ArrayUtils.supplement(o, e.length),
                                    f.ArrayUtils.randomArray(o),
                                    (this._buildTime = 0),
                                    (this._buildCount = 3),
                                    (this._dieIdx = 0),
                                    (this._idx = 0),
                                    (this._infos = []),
                                    (this._mixLevel = a.default.getMonsterMinLevel(t));
                                for (var c = 0; c < e.length; c++) {
                                    var u = new s.default(e[c]);
                                    (u.drop = o[c]), this._infos.push(u);
                                }
                                this.checkHp();
                            }),
                            (e.prototype.onHpChangedHandler = function(t) {
                                if (t.hp <= 0 && t.info.drop > 0) {
                                    var e = new h.ItemActor(t.info.drop);
                                    (e.entity.x = t.entity.x),
                                    (e.entity.y = t.entity.y),
                                    (e.entity.zIndex = t.entity.zIndex),
                                    this._scene.addItem(e);
                                }
                            }),
                            (e.prototype.onStart = function() {
                                t.prototype.onStart.call(this),
                                    (this._battleIndex = a.default.SoldierWarCount),
                                    (this._dieCount = 0),
                                    (this._dieIdx = 0);
                            }),
                            (e.prototype.checkHp = function() {
                                for (var t = 0, e = 0; e < this._infos.length; e++) {
                                    t += this._infos[e].hp;
                                }
                                this._hp != t &&
                                    ((this._hp = t),
                                        t > this._hpMax && (this._hpMax = t),
                                        this.emit(c.InfoEvent.HPChanged, this));
                            }),
                            (e.prototype.onStop = function() {
                                for (var t = 0; t < this._battlers.length; t++) {
                                    var e = this._battlers[t];
                                    this._scene.removeActor(e, !0);
                                }
                                this._battlers.splice(0, this._battlers.length);
                            }),
                            (e.prototype.getRow = function() {
                                for (var t = 0; t < 10; t++) {
                                    var e = l.default.randomFloat(-3, 3);
                                    if (e != this._row) {
                                        this._row = e;
                                        break;
                                    }
                                }
                                return this._row;
                            }),
                            (e.prototype.onUpdate = function(t) {
                                for (var e = 0, o = 0, n = 0; n < this._infos.length; n++) {
                                    (s = this._infos[n]).hp <= 0 && o++, (e += s.hp);
                                }
                                if (this._idx < this._infos.length) {
                                    if (this._buildTime <= 0) {
                                        var i = this._infos[this._idx],
                                            s = new r.MonsterActor(i, this._chapter.monsterModel),
                                            u =
                                            0.1 +
                                            (l.default.clamp(i.level - this._mixLevel + 1, 1, 6) /
                                                6) *
                                            0.9;
                                        (s.entity.x = 480 + l.default.randomFloat(-15, 15)),
                                        s.on(
                                                c.InfoEvent.HPChanged,
                                                this.onHpChangedHandler,
                                                this
                                            ),
                                            (s.entity.y = 10 * this.getRow()),
                                            s.appear(),
                                            i.isBoss || (s.entity.scale = u),
                                            this._idx,
                                            a.default.SoldierWarCount,
                                            s.appear(),
                                            this._scene.addActor(s),
                                            this._battlers.push(s),
                                            this._idx++,
                                            (this._buildTime = 60 / a.default.MoveSpeed);
                                    }
                                    this._buildTime -= t;
                                }
                                o > this._dieCount &&
                                    ((this._dieIdx += o - this._dieCount), (this._dieCount = o)),
                                    this._dieIdx > 0 &&
                                    (s = this.getWaitActor()) &&
                                    (s.appear(), this._dieIdx--),
                                    this._hp != e &&
                                    ((this._hp = e),
                                        e > this._hpMax && (this._hpMax = e),
                                        this.emit(c.InfoEvent.HPChanged, this));
                            }),
                            e
                        );
                    })(u.AbsCtrl);
                (o.EnemyCtrl = d), console.log("end");
            module.exports =  e.exports;